﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/PBOAMasterPage.master" AutoEventWireup="true" CodeFile="newsManage.aspx.cs" Inherits="NewsManageModule_newsManage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<link type="text/css" rel="Stylesheet" href="../css/News.css" />
<title>新闻管理</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<uc:Navigator Text="新闻管理" runat="server" />
<div id ="News">
<div id="News_top">
<a>新闻类型：</a>
    <asp:DropDownList ID="ddlNewsType" runat="server" Width="95px" 
        DataSourceID="odsNewsType" DataTextField="NewsTypeId" DataValueField="NewsTypeNo">
    </asp:DropDownList>&nbsp;
    <asp:Button ID="btnView" runat="server" Text="查询" CssClass="ButtonImage" 
        onclick="btnView_Click" />
    <br />
    <asp:ObjectDataSource ID="odsNewsType" runat="server" 
        SelectMethod="ShowNewsType" TypeName="PBOffice.BLL.NewsManager">
    </asp:ObjectDataSource>
</div>
<div id="News_mid">
    <asp:LinkButton ID="lbtnAddNews" runat="server" CssClass="lbtnAddNews"  PostBackUrl="~/NewsManageModule/newsPublish.aspx" >添加新闻</asp:LinkButton></div>
<div id ="News_bottom">
    <asp:GridView ID="gvNews" runat="server" CellPadding="4" ForeColor="#333333" 
        GridLines="None" CssClass="gvNews" AutoGenerateColumns="False" 
        Font-Size="14px" Width="680px" 
        DataSourceID="odsNews">
        <AlternatingRowStyle BackColor="White" />
        <Columns>
            <asp:BoundField DataField="NewsNo" HeaderText="新闻ID">
            <HeaderStyle Height="30px" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Height="30px" />
            </asp:BoundField>
            <asp:BoundField DataField="NewsTitle" HeaderText="标题" >
            <HeaderStyle Height="30px" />
            <ItemStyle Height="30px" />
            </asp:BoundField>
            <asp:BoundField DataField="NewsTypeId" HeaderText="类型">
            <HeaderStyle Height="30px" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Height="30px" />
            </asp:BoundField>
            <asp:BoundField DataField="IsTop" HeaderText="是够置顶">
            <HeaderStyle Height="30px" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Height="30px" />
            </asp:BoundField>
            <asp:BoundField DataField="IsRecommend" HeaderText="是否推荐">
            <HeaderStyle Height="30px" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Height="30px" />
            </asp:BoundField>
            <asp:ButtonField ButtonType="Image" HeaderText="修改"  
                ImageUrl="~/Images/edit.gif" Text="按钮">
            <HeaderStyle Height="30px" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Height="30px" />
            </asp:ButtonField>
            <asp:ButtonField ButtonType="Image" HeaderText="删除" 
                ImageUrl="~/Images/delete.gif" Text="按钮">
            <HeaderStyle Height="30px" />
            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Height="30px" />
            </asp:ButtonField>
        </Columns>
        <EditRowStyle BackColor="#2461BF" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#EFF3FB" />
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#F5F7FB" />
        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
        <SortedDescendingCellStyle BackColor="#E9EBEF" />
        <SortedDescendingHeaderStyle BackColor="#4870BE" />
    </asp:GridView>
    <asp:ObjectDataSource ID="odsNews" runat="server" 
        DataObjectTypeName="PBOffice.DAL.News" DeleteMethod="DeleteNewsInfo" 
        InsertMethod="AddNewsInfo" SelectMethod="ShowNewsInfo" 
        TypeName="PBOffice.BLL.NewsManager" UpdateMethod="ChangeNewsInfo">
        <DeleteParameters>
            <asp:Parameter Name="newsNo" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="n" Type="Object" />
            <asp:Parameter Name="userNo" Type="Int32" />
            <asp:Parameter Name="newsTypeNo" Type="Int32" />
        </InsertParameters>
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlNewsType" DefaultValue="SelectedValue" 
                Name="newsTypeNo" PropertyName="SelectedValue" Type="Int32" />
        </SelectParameters>
    </asp:ObjectDataSource>
</div>
<div style="height:100px;text-align:center;color:red;margin-top:20px;font-size:14px;"><asp:Label ID="lblNone" runat="server" Text="抱歉，该类型的新闻！" Visible="false"></asp:Label></div>
</div>
</asp:Content>

